home *** CD-ROM | disk | FTP | other *** search
/ Inventor Labs: Technology / INVENTORLABS_TECHNOLOGY.BIN / mac / FILES / SHARED.CST / 00424_Script_Patent Object Script < prev    next >
Text File  |  1997-07-24  |  9KB  |  258 lines

  1. --o Patent object
  2.  
  3. --instantiated as gPatentObj
  4.  
  5. property pZoomedIn, pDisplayingPatents
  6. property pBackGSpriteNum, pDogEarSpriteNum, pDrawerSpriteNum, pPatentPictSpriteNum
  7. property pLeftBarSpriteNum
  8. property pPatentLocH, pPatentLocV
  9. property pTextLineCounter, pCurrentTextDB, pTextFieldCastNameList
  10. property pBackGrndBaseCastList
  11.  
  12. property pFirstCastNumList, pLastCastNumList
  13. --BELL SPECIFIC PROPERTIES
  14. property pBellFirstCast, pBellLastCast, pBellBackGrndBaseCastName, pBellTextFieldCastName
  15. --WATT SPECIFIC PROPERTIES
  16. property pWattFirstCast, pWattLastCast, pWattBackGrndBaseCastName, pWattTextFieldCastName
  17. --EDISON SPECIFIC PROPERTIES
  18. property pEdisonFirstCast, pEdisonLastCast
  19.  
  20. property pPageSnd,pDrawerSndList
  21. property pmaxLocv
  22. property pMinLocv
  23.  
  24. global gInventorIndexNum, gScoreEventObj, gUtilityObj, gInterfaceMgrObj
  25. global gActorListMgrObj
  26. ------------------------------------------------------------------<<ò>>
  27. on mInit me
  28.   
  29.   set pTextLineCounter = 0
  30.   set pFirstCastNumList = [0,0,0]
  31.   set pLastCastNumList = [0,0,0]
  32.   set pTextFieldCastNameList = [0,0,0]
  33.   set pBackGrndBaseCastList = [0,0,0]
  34.   
  35.   set pPatentLocH = 240
  36.   set pPatentLocV = 260
  37.   
  38.   --BELL
  39.   set pBellFirstCast = "BPATN1A.PIC"
  40.   set pBellLastCast = "BPATN12A.PIC"
  41.   set pBellBackGrndBaseCastName = "BDESK2.PIC"
  42.   set pBellTextFieldCastName = "Bell Patent Text"
  43.   
  44.   
  45.   --WATT
  46.   set pWattFirstCast = "WPATNT1A.PIC"
  47.   set pWattLastCast = "WPATNT11A.PIC"
  48.   set pWattBackGrndBaseCastName = "WDESKBK1.PIC"
  49.   set pWattTextFieldCastName = "Watt Patent Text"
  50.   
  51.   set pBackGSpriteNum = 2
  52.   set pPatentPictSpriteNum = 9
  53.   set pDogEarSpriteNum = 10
  54.   set pDrawerSpriteNum = 6
  55.   set pLeftBarSpriteNum = 21  --RightBarSpriteNum is this + 1
  56.   
  57.   set pDrawerSndList = [0, "BDRAWER.AIF", "BDRAWER.AIF"]
  58.   set pPageSnd = 1392
  59.   return me
  60.   
  61. end mInit
  62. ------------------------------------------------------------------<<ò>>
  63. on mActivate me
  64.   
  65.   puppetSprite pBackGSpriteNum, true
  66.   puppetSprite pPatentPictSpriteNum, true
  67.   set snd  = getAt(pDrawerSndList, gInventorIndexNum)
  68.   puppetsound 2, snd
  69.   updatestage
  70.   
  71.   set pDisplayingPatents = false
  72.   set pZoomedIn = false
  73.   set pCurrentTextDB = " "
  74.   set TempPropList = [:]
  75.   addProp (TempPropList, value(pDrawerSpriteNum), #ZoomIN)
  76.   mSetCursors(gUtilityObj, TempPropList)
  77.   if gInventorIndexNum = 1 then
  78.     --EDISON
  79.     set pmaxLocv = 438
  80.     set pMinLocv = 82
  81.   else if gInventorIndexNum = 3 then
  82.     --WATT
  83.     setAt(pFirstCastNumList, 3, (the number of cast pWattFirstCast))
  84.     setAt(pLastCastNumList, 3, (the number of cast pWattLastCast))
  85.     setAt(pTextFieldCastNameList, 3, (the number of cast pWattTextFieldCastName))
  86.     setAt(pBackGrndBaseCastList, 3, (the number of cast pWattBackGrndBaseCastName))
  87.     set pmaxLocv = 377
  88.     set pMinLocv = 142
  89.   else if gInventorIndexNum = 2 then
  90.     --BELL
  91.     setAt(pFirstCastNumList, 2, (the number of cast pBellFirstCast))
  92.     setAt(pLastCastNumList, 2, (the number of cast pBellLastCast))
  93.     setAt(pTextFieldCastNameList, 2, (the number of cast pBellTextFieldCastName))
  94.     setAt(pBackGrndBaseCastList, 2, (the number of cast pBellBackGrndBaseCastName))
  95.     set pmaxLocv = 438
  96.     set pMinLocv = 82
  97.   end if
  98.   
  99.   mSetToolBtns (gInterfaceMgrObj, #PATENTS, me)
  100.   
  101. end mActivate
  102. ------------------------------------------------------------------<<ò>>
  103. on mClose me
  104.   
  105.   set the locv of sprite pPatentPictSpriteNum = -1000
  106.   puppetSprite pBackGSpriteNum, false
  107.   puppetSprite pPatentPictSpriteNum, false
  108.   updatestage
  109.   mUnsetCursorList(gUtilityObj, [pPatentPictSpriteNum, pDogEarSpriteNum, pDrawerSpriteNum])
  110.   
  111. end mClose
  112. ------------------------------------------------------------------<<ò>>
  113.  
  114. on mPatentClickEvent me
  115.   
  116.   set SpriteClicked = the clickOn
  117.   
  118.   if SpriteClicked = pDogEarSpriteNum then
  119.     
  120.     if pDisplayingPatents and (not pZoomedIn) then 
  121.       
  122.       mDogEarClick(me)
  123.     end if
  124.   else if (SpriteClicked = pDrawerSpriteNum) and (not pDisplayingPatents) then 
  125.     mDisplayPatents(me)
  126.   else if (SpriteClicked = pLeftBarSpriteNum) or (Spriteclicked = pLeftBarSpriteNum + 1) then
  127.     if pZoomedIn then 
  128.       mSwitchZoomLevel(me)
  129.     else if not pZoomedIn then 
  130.       mInitiatePullOut (me)
  131.     end if
  132.   end if
  133.   
  134. end mPatentClickEvent
  135. ------------------------------------------------------------------<<ò>>
  136. on mDisplayPatents me
  137.   
  138.   
  139.   set pTextLineCounter = 1
  140.   set pCurrentTextDB = getAt(pTextFieldCastNameList, gInventorIndexNum)
  141.   
  142.   mUpdateText(me)
  143.   
  144.   set tempPropList = [:]
  145.   addProp (tempPropList, value(pPatentPictSpriteNum), #ZoomIn)
  146.   addProp (tempPropList, value(pDogEarSpriteNum), #FINGER)
  147.   mUnsetCursorList(gUtilityObj, [pPatentPictSpriteNum, pDogEarSpriteNum, pDrawerSpriteNum])
  148.   mSetCursors(gUtilityObj, tempPropList)
  149.   set pDisplayingPatents = true
  150.   set the castNum of sprite pPatentPictSpriteNum = getAt(pFirstCastNumList, gInventorIndexNum)
  151.   set the locH of sprite pPatentPictSpriteNum = pPatentLocH
  152.   set the locV of sprite pPatentPictSpriteNum = pPatentLocV
  153.   set the castNum of sprite pBackGSpriteNum = (getAt(pBackGrndBaseCastList, gInventorIndexNum))
  154.   updateStage
  155.   set pZoomedIn = false
  156.   
  157. end mDisplayPatents
  158. ------------------------------------------------------------------<<ò>>
  159. on mSwitchZoomLevel me
  160.   
  161.   
  162.   if pZoomedIn then
  163.     set the castNum of sprite pPatentPictSpriteNum = (the castNum of sprite pPatentPictSpriteNum) - 1
  164.     set the locV of sprite pPatentPictSpriteNum = pPatentLocV
  165.     set tempPropList = [:]
  166.     addProp (tempPropList, value(pPatentPictSpriteNum), #ZoomIn)
  167.     addProp (tempPropList, value(pDogEarSpriteNum), #FINGER)
  168.     
  169.     mUnsetCursorList(gUtilityObj, [pPatentPictSpriteNum, pDogEarSpriteNum, pDrawerSpriteNum])
  170.     mSetCursors(gUtilityObj, tempPropList)
  171.     
  172.   else if not pZoomedIn then
  173.     set the castNum of sprite pPatentPictSpriteNum = (the castNum of sprite pPatentPictSpriteNum) + 1
  174.     set tempPropList = [:]
  175.     addProp (tempPropList, value(pPatentPictSpriteNum), #Operate)
  176.     mUnsetCursorList(gUtilityObj, [pPatentPictSpriteNum, pDogEarSpriteNum, pDrawerSpriteNum])
  177.     mSetCursors(gUtilityObj, tempPropList)
  178.   end if
  179.   updateStage
  180.   set pZoomedIn = not pZoomedIn
  181.   
  182. end mSwitchZoomLevel
  183. ------------------------------------------------------------------<<ò>>
  184. on mDogEarClick me
  185.   
  186.   sound stop 2
  187.   updatestage
  188.   puppetsound 2, pPageSnd
  189.   if the castNum of sprite pPatentPictSpriteNum = getAt(pLastCastNumList, gInventorIndexNum) then
  190.     set the castNum of sprite pPatentPictSpriteNum = getAt(pFirstCastNumList, gInventorIndexNum)
  191.     set pTextLineCounter = 1
  192.   else 
  193.     set the castNum of sprite pPatentPictSpriteNum = (the castNum of sprite pPatentPictSpriteNum) + 2
  194.     set pTextLineCounter = pTextLineCounter + 6
  195.   end if
  196.   mUpdateText(me)
  197.   updateStage
  198.   
  199. end mDogEarClick
  200. ------------------------------------------------------------------<<ò>>
  201. on mInitiatePullOut me
  202.   
  203.   mClose(me)
  204.   mPullOut(gScoreEventObj)
  205.   
  206. end mInitiatePullOut
  207. ------------------------------------------------------------------<<ò>>
  208. on mDragBlownUpPatent me
  209.   
  210.   set InitialMouseV = the mouseV
  211.   set InitialPatentLocV = the locV of sprite pPatentPictSpriteNum
  212.   mSuspendActorlist (gActorListMgrObj )
  213.   repeat while the mouseDown
  214.     set mouseDelta = the mouseV - InitialMouseV
  215.     set NewPatentLocV = InitialPatentLocV + mouseDelta
  216.     if NewPatentLocV > pmaxLocv then set NewPatentLocV = pmaxLocv
  217.     if NewPatentLocV < pMinLocv then set NewPatentLocV = pMinLocv
  218.     set the locV of sprite pPatentPictSpriteNum = NewPatentLocV
  219.     updateStage
  220.   end repeat
  221.   mResumeActorlist ( gActorListMgrObj )
  222.   
  223. end mDragBlownUpPatent
  224. ------------------------------------------------------------------<<ò>>
  225. on mUpdateText me
  226.   
  227.   set labelString = line pTextLineCounter to  (pTextLineCounter + 2) of field pCurrentTextDB
  228.   set BodyString = line (pTextLineCounter + 3) to  (pTextLineCounter + 5) of field pCurrentTextDB
  229.   mDisplaySecondaryText(gUtilityObj, LabelString, BodyString)
  230.   
  231. end mUpdateText
  232. ------------------------------------------------------------------<<ò>>
  233. on mPatentDownClick me
  234.   
  235.   if pDisplayingPatents and pZoomedIn then 
  236.     mDragBlownUpPatent(me)
  237.     dontPassEvent
  238.   end if
  239.   
  240. end mPatentDownClick
  241. ------------------------------------------------------------------<<ò>>
  242. on mPatentUpClick me
  243.   
  244.   if pDisplayingPatents and not pZoomedIn then mSwitchZoomLevel(me)
  245.   
  246. end mPatentUpClick
  247. ------------------------------------------------------------------<<ò>>
  248. on mZoom me, whatselection
  249.   
  250.   if (whatselection = 1) and  ( pZoomedIn) then 
  251.     mSwitchZoomLevel me
  252.   else if (whatselection = 2) and not pZoomedIn then
  253.     mSwitchZoomLevel me
  254.   end if
  255.   
  256. end mZoom
  257. ------------------------------------------------------------------<<ò>>
  258.